items = [1,2,3,4,5]
squared = []
for i in items:
    squared.append(i**2)
print(squared)

squared_map = list(map(lambda x: x**2, items))
print("squared map")
print(squared_map)

def multiply(x):
    return (x*x)
def add(x):
    return (x+x)

funcs = [multiply, add]
for i in range(5):
    value = map(lambda x: x(i), funcs)
    print(list(value))

print("filter test")
number_list = range(-5, 5)
less_than_zero = filter(lambda x: x<0, number_list)
print(list(less_than_zero))

print("reduce test")
from functools import reduce
print(reduce((lambda x, y: x*y), [1,2,3,4]))